<fieldset>
    <legend><b>Cadatro de bilhete</b></legend>
    <form action="?" method="POST">
        <input type="hidden" name="acao" value="cadastrarBilhete" />
        <input type="hidden" name="aba" value="3" />
        <input type="hidden" id="idCliente" name="idCliente"  />

        <fieldset>
            <legend>Dados do bilhete</legend>
             <table>
            <tr>
                <td>
                    <label for="localizador">Localizador:</label>
                    <input type="text" id="localizador" name="localizador" value="<?php echo $request->getParam('localizador');?>"/>
                </td>
                <td>
                    <label for="cia_aerea">Companhia aerea:</label>
                    <input type="text" id="cia_aerea" name="cia_aerea" value="<?php echo $request->getParam('cia_aerea');?>"/>
                </td>
                 <td>
                    <label for="num_bilhete">Número do bilhete:</label>
                    <input type="text" id="num_bilhete" name="num_bilhete" value="<?php echo $request->getParam('num_bilhete');?>"/>
                </td>
                 <td>
                    <label for="data_emissao">Data de emissão:</label>
                    <input type="text" class="data" id="data_emissao" name="data_emissao" value="<?php echo $request->getParam('data_emissao');?>"/>
                </td>
            </tr>
            <tr>
                <td>
                    <label for="dt_ida">Data de ida:</label>
                    <input type="text" class="data" id="dt_ida" name="dt_ida" value="<?php echo $request->getParam('dt_ida');?>"/>
                </td>
                <td>
                    <label for="dt_volta">Data de volta:</label>
                    <input type="text" class="data" id="dt_volta" name="dt_volta" value="<?php echo $request->getParam('dt_volta');?>"/>
                </td>
               <td>
                    <label for="origem">Origem:</label>
                    <select name="origem" id="origem">
                        <option value="">Selecione...</option>
                         <?php if( !is_null($objDestinoBO = $request->getAttribute('objDestinoBO')) ): ?>
                        <?php foreach ($objDestinoBO as $val): ?>
                        <option value="<?php echo $val->getDestino()->getId() ?>" <?php echo $request->getParam('origem') == $val->getDestino()->getId() ? ' selected' : '' ;?> ><?php echo $val->getDestino()->getDescricao(); ?></option>
                        <?php endforeach; ?>
                        <?php endif; ?>
                    </select>
                </td>
                <td>
                   
                    <label for="destino">Destino:</label>
                    <select name="destino" id="destino">
                        <option value="">Selecione...</option>
                        <?php if( !is_null($objDestinoBO = $request->getAttribute('objDestinoBO')) ):?>
                        <?php foreach ($objDestinoBO as $val): ?>
                        <option value="<?php echo $val->getDestino()->getId() ?>" <?php echo $request->getParam('destino') == $val->getDestino()->getId() ? 'selected' : '';?> ><?php echo $val->getDestino()->getDescricao(); ?></option>
                        <?php endforeach; ?>
                        <?php endif; ?>
                    </select>
                </td>
            </tr>
            <tr>
               <td>
                    <label for="pagamento">Tipo de pagamento:</label>
                    <select name="tipo_pagamento_id" id="pagamento">
                        <option value="">Selecione...</option>
                        <?php if( !is_null($objPagamentoBO = $request->getAttribute('objPagamentoBO')) ):?>
                        <?php foreach ($objPagamentoBO as $val): ?>
                        <option value="<?php echo $val->getDestino()->getId() ?>" <?php echo $request->getParam('tipo_pagamento_id') == $val->getDestino()->getId() ? 'selected' : '';?>><?php echo $val->getDestino()->getDescricao(); ?></option>
                        <?php endforeach; ?>
                        <?php endif; ?>
                    </select>
                </td>
                <td>
                    <label for="operacao">Tipo de operação:</label>
                    <select name="tipo_operacao_id" id="operacao">
                        <option value="">Selecione...</option>
                        <?php if( !is_null($objOperacaoBO = $request->getAttribute('objOperacaoBO')) ) :?>
                        <?php foreach ($objOperacaoBO as $val): ?>
                        <option value="<?php echo $val->getDestino()->getId() ?>" <?php echo $request->getParam('tipo_operacao_id') == $val->getDestino()->getId() ? 'selected' : '';?>><?php echo $val->getDestino()->getDescricao(); ?></option>
                        <?php endforeach; ?>
                        <?php endif; ?>
                    </select>
                </td>
                <td colspan="4">
                    <label for="cliente">Cliente:</label>
                    <!-- Estrutura para cliente -->
                    <input type="text" id="cliente" name="cliente" onkeyup="buscaCliente($(this).val());" autocomplete="off"/>
                        <ul id="clientes">
                            <?php $listaClientes = !is_null( $request->getAttribute('listaClientes') ) ? $request->getAttribute('listaClientes') : array() ?>
                            <?php foreach ($listaClientes as $objCliente): ?>
                            <li  onclick="selecionarCliente(<?php echo $objCliente->getId(); ?>, '<?php echo $objCliente->getNome();?>');" ><?php echo $objCliente->getNome(); ?></li>
                            <?php endforeach;?>
                        </ul>
                     <!-- Estrutura para cliente -->
                    </div>
                </td>
            </tr>
        </table>
        </fieldset>
        
        <fieldset>
            <legend>Valores e taxas</legend>
            <table>
            <tr>
                <td>
                    <label for="val_du">Valor da DU:</label>
                    <input type="text" id="val_du" name="val_du" value="<?php echo $request->getParam('val_du');?>"/>
                </td>          
                <td>
                    <label for="val_pagar">Valor a pagar:</label>
                    <input type="text" id="val_pagar" name="val_pagar" value="<?php echo $request->getParam('val_pagar');?>"/>
                </td>
                <td>
                    <label for="val_receber">Valor a receber:</label>
                    <input type="text" id="val_receber" name="val_receber" value="<?php echo $request->getParam('val_receber');?>"/>
                </td>
                <td>
                    <label for="val_multa_moeda">Valor da multa em moeda:</label>
                    <input type="text" id="val_multa_moeda" name="val_multa_moeda" value="<?php echo $request->getParam('val_multa_moeda');?>"/>
                </td>
            </tr>
            <tr>
                <td>
                    <label for="val_multa_pontos">Valor da multa em pontos:</label>
                    <input type="text" id="val_multa_pontos" name="val_multa_pontos" value="<?php echo $request->getParam('val_multa_pontos');?>"/>
                </td>
                
                 <td>
                    <label for="tx_embarque">Taxa de embarque:</label>
                    <input type="text" id="tx_embarque" name="tx_embarque" value="<?php echo $request->getParam('tx_embarque');?>"/>
                </td>
                <td>
                    <label for="meta_domestica">Meta doméstica:</label>
                    <input type="text" id="meta_domestica" name="meta_domestica" value="<?php echo $request->getParam('meta_domestica');?>"/>
                </td>
                <td>
                    <label for="percent_domestico">Percentual doméstico:</label>
                    <input type="text" id="percent_domestico" name="percent_domestico" value="<?php echo $request->getParam('percent_domestico');?>"/>
                </td>
            </tr>
        </table>
        </fieldset>
        <br>
        
        <input class="btn btn-success" type="submit" value="Cadastrar" />
        
    </form>
</fieldset>

